package com.example.ex05;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends Activity {
	EditText brdText = null;
	Button sub_btn = null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		brdText = (EditText)findViewById(R.id.widget_edit_text);
		sub_btn = (Button)findViewById(R.id.submint_btn);
		sub_btn.setOnClickListener( subListener );
	}

	OnClickListener subListener = new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			Intent intent = new Intent("test_2013");
			intent.putExtra("msg", 
					((EditText)findViewById(R.id.widget_edit_text) ).getText().toString().trim());
			sendBroadcast(intent);
		}
	};

}
